﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using CommDll;
using System.Threading;   
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Reflection;

namespace InstitutionAssitant
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // 01 是否唯一运行
            if (AppInfo._runningInstance() == null)
            {
                // 02 不更新打开程序
                if (!AppInfo._isUpdate())
                {
                    // 03 系统初始化
                    Application.Run(new frmSplash());
                    if (AppInfo.m_bAppState) 
                    {
                        // 04 用户登录
                        Application.Run(new frmLogin());
                        if (AppInfo.m_bLogin)
                        {
                            Application.Run(new frmMain());
                        }      
                    }
                }
            }
            else
            {
                CommFun._messageBoxShow(string.Format("【{0}】已经运行！", AppInfo.m_strAppName), string.Format("【{0}】-系统提示！", AppInfo.m_strAppName), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
    }
}
